package com.yunxin.admin.system.infra.persistence.converter;

import com.yunxin.admin.system.domain.model.user.User;
import com.yunxin.admin.system.domain.model.user.UserSimple;
import com.yunxin.admin.system.infra.persistence.entity.SysUserDO;
import org.mapstruct.Mapper;

/**
 * @author zero°
 * @since 2023-07-11
 */
@Mapper(componentModel = "spring")
public interface UserConverter {

    /**
     * do 转 entity
     * @param sysUserDO sysUserDO
     * @return User
     */
    UserSimple toUserSimple(SysUserDO sysUserDO);

    /**
     * entity 转 do
     * @param entity entity
     * @return SysUserDO
     */
    SysUserDO formUser(User entity);

}
